/**
 * @author Sebastian
 * @version 2.0
 * @date 2024/5/30 21:08
 */
public class Solution206 {
    public ListNode reverseList(ListNode head) {
        ListNode cur = head;
        ListNode prev = null;
        ListNode tmp = null;
        while (cur != null) {
            tmp = cur.next;
            cur.next = prev;
            prev = cur;

            cur = tmp;
        }
        return prev;
    }
}
